package com.boot.service;

import com.boot.dao.UserDao;
import com.boot.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

//这里使用什么动态代理?
//JDK、cglib
//JDK:基于接口的
//cglib:基于类的
@Service
public class UserService {

    @Autowired
    UserDao userDao;

    public Boolean login(User user){
        return userDao.getUser(user) != null;
    }

    public List<User> list() {
        return userDao.list();
    }

    public void deleteById(Long id) {
        userDao.deleteById(id);
    }
}
